package ar.com.vates.vspJava.capitulo5.ejercicio2;

public class AgregarValor implements Runnable {

	Thread t = new Thread();

	@Override
	public synchronized void run() {
		t.start();
		Contenedor c = new Contenedor();
		
		if(c.getNumero() != 0){
			try {
				t.wait();
			} catch (InterruptedException e) {
				System.out.println(e);
			}
		}
		else{
			c.AgregarNumero(5);
		}		
	}
}